home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / macros / plain / contrib / paragraphs.tex < prev    next >
Encoding:
Text File  |  1992-08-26  |  2.5 KB  |  92 lines

  1. %
  2. % some of the old Tbase paragraphing macros (built on Plain TeX)
  3. %
  4. % These macros demonstrate common uses for the
  5. % \hangindent, \hangafter, \indent, \noindent, \everypar,
  6. % \lastbox, and \the commands.
  7. %
  8.  
  9. \catcode`\@=11\relax            % make @ a letter for use in macro names
  10.  
  11. %
  12. % N.B. These macros do not set a ``paragraphing mode,'' as
  13. % they used to in Tbase; they apply only to the immediately
  14. % following paragraph.
  15. %
  16. % The right way to use one of the macros is, e.g.,
  17. %
  18. % \ivp This is an inverted paragraph... 
  19. % and so on, and so on...
  20. %
  21. \def\ivp {% inverted paragraph, all but 1st line indented
  22.   \hangindent \parindent
  23.   \hangafter \@ne
  24.   \noindent}
  25.  
  26. \def\ip {% indented paragraph, all lines indented
  27.   \hangindent \parindent
  28.   \hangafter \@ne
  29.   \indent}
  30.  
  31. \def\ftp #1{% flush-tagged paragraph, like \ip but with tag on left margin
  32.   \hangindent \parindent
  33.   \hangafter \@ne
  34.   \noindent \hbox to\parindent{#1\hfil}\ignorespaces}
  35.  
  36. \def\atp #1{% adjoint-tagged par, like \ftp but tag is next to first line
  37.   \hangindent \parindent
  38.   \hangafter \@ne
  39.   \indent \llap{#1\enspace}\ignorespaces}
  40.  
  41. \def\bpar {% bullet-tagged paragraph
  42.   \ftp{$\bullet$}}
  43.  
  44.  
  45. %
  46. % vest paragraphs:
  47. %   After an interruption in the running text (such as a section
  48. % title or in-line illustration), it is customary not to indent
  49. % the first line of the next paragraph.  The macro \vp arranges
  50. % for this to be the case by making sure that \unindent gets
  51. % called as soon as the paragraph starts.  \unindent simply
  52. % removes the \indent box that TeX automatically puts at the
  53. % start of every paragraph (except those which start with
  54. % \noindent).
  55. %
  56. \def\unindent {%
  57.   \setbox0=\lastbox}            % get the indent box and discard it
  58.  
  59. \def\vp {%
  60.   \everypar{\unindent\everypar{}}}
  61.  
  62.  
  63. %
  64. % the \heading macro puts out a bold-faced unindented heading,
  65. % and then calls \vp to insure that the next paragraph does not
  66. % start with an indentation.
  67. % No break is allowed between the heading and the paragraph.
  68. %
  69. \def\heading #1{%
  70.   \vskip 1ex
  71.   {\bf\noindent #1\par}
  72.   \nobreak
  73.   \vskip.5ex
  74.   \vp}
  75.  
  76.  
  77. %
  78. % These next two macros are a convenient way of turning
  79. % indentation off and then on again.  The macro \fp
  80. % sets \parindent to 0, but not before defining the macro \pp so
  81. % that it restores \parindent to what it was.  The \edef command
  82. % in conjunction with the \the command actually put the
  83. % value of \parindent into the text of the \pp command.
  84. % Do \fp\show\pp to see what this means.
  85. %
  86. \def\fp {\edef\pp{\parindent=\the\parindent}\parindent=\z@}
  87. \let\pp=\relax
  88.  
  89.  
  90. % make @ back into a non-letter
  91. \catcode`\@=12\relax
  92.